<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>YK Value-added System</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<link rel="stylesheet" type="text/css" href="css/admin.css" />
	<link rel="stylesheet" type="text/css" href="css/common.css" />
	<script src="<%=basePath%>js/Validator.js" type="text/javascript"></script>
	<script type="text/javascript">
		function changeEmail(value){
			if(value=='A'){
				document.getElementById("email").value="AA";
			}else if(value=='B'){
				document.getElementById("email").value="BB";
			}else{
				document.getElementById("email").value="CC";
			}
		}

	</script>
	
  </head>
  
  <body>
<table width="95%" border="0" align="center" cellspacing="0">
  <tr>
    <td height="30">
    	<table width="60%" border="0">
		     <tr>
		        	<td width="30"><img src="images/location_left.gif" width="24" height="30" /></td>
		        	<td>
		        		您当前的位置是：系统管理 -&gt;用户管理 -&gt;修改用户信息<br>
		        	</td>
		    </tr>
		    <tr>
		         	<td colspan="2"><hr width="100%" align="left"></td>
			</tr>
	    </table>
    </td>
  </tr>
  <tr>
    <td><form id="form1" name="form1" method="post" action="<%=basePath%>admin/system/userMgr/userMgr!editUser.action" onsubmit="return Validator.Validate(this,2);">
      <table width="60%" border="0" cellspacing="3">
      	<tr>
          <td><font color="red" style="font-size:12px;"></font></td>
         <td>
          <font color="green" style="font-size:12px;"><s:actionmessage/></font>
          </td>
		</tr>
		<tr>
          <td width="20%" align="right">
          	<span class="style">*</span>用户名：
          </td>
          <td width="30%">
          	${user.username}
          	<input type="hidden" id="id" name="id" value="${user.id}"/>
          </td>
          <td width="20%" align="right">
          	姓名：
          </td>
          <td width="30%">
          	<input type="text" style="width:150px" id="name" name="name" value="${user.name}" maxlength="25"
			onfocus="currentBackgroundColor=this.style.backgroundColor;this.style.background='#FFFF99';" 
			onblur="this.style.backgroundColor=currentBackgroundColor;" style="height: 25px;"/>
          </td>
        </tr>
        <tr>
          <td width="20%" align="right">
          	<span class="style">*</span>性别：
          </td>
          <td width="30%">
          		<input type="radio" name="sex" id="sex"  value="1" <c:if test="${user.sex=='1'}">checked</c:if>/>男
			   <input type="radio" name="sex" id="sex" value="0" <c:if test="${user.sex=='0'}">checked</c:if>/>女
          </td>
          <td width="20%" align="right">
          	部门：
          </td>
          <td width="30%">
          	<select id="dept_id" name="dept_id">
          		<option value="">--请选择--</option>
          		<c:forEach items="${deptList}" var="dept">
          			<option value="${dept.id}" <c:if test="${dept.id==user.dept_id}">selected</c:if> >${dept.name}</option>
          		</c:forEach>
          	</select>
          </td>
          
        </tr>
        <tr>
          <td width="20%" align="right">
          	QQ：
          </td>
          <td width="30%">
          		<input type="text" style="width:150px" dataType="QQ" msg="QQ号码不存在" Require="false" id="qq" name="qq" value="${user.qq}" maxlength="25"
					onfocus="currentBackgroundColor=this.style.backgroundColor;this.style.background='#FFFF99';" 
			onblur="this.style.backgroundColor=currentBackgroundColor;"
					onkeyup="changeEmail(this.value);"
				 style="height: 25px;"/>
          </td>
          <td width="20%" align="right">
          	邮箱：
          </td>
          <td width="30%">
          	<input type="text" style="width:150px" dataType="Email" msg="邮箱格式不正确" Require="false" id="email" name="email" value="${user.email}" maxlength="25"
			onfocus="currentBackgroundColor=this.style.backgroundColor;this.style.background='#FFFF99';" 
			onblur="this.style.backgroundColor=currentBackgroundColor;" style="height: 25px;"/>
          </td>
          
        </tr>
        <tr>
        	<td width="20%" align="right">
          	手机号码：
          </td>
          <td width="30%">
          	<input type="text" style="width:150px" dataType="Mobile" msg="手机号码不正确" Require="false" id="mobile" name="mobile" value="${user.mobile}" maxlength="25"
			onfocus="currentBackgroundColor=this.style.backgroundColor;this.style.background='#FFFF99';" 
			onblur="this.style.backgroundColor=currentBackgroundColor;" style="height: 25px;"/>
          </td>
          <td width="20%" align="right">
          	电话号码：
          </td>
          <td width="30%">
          		<input type="text" style="width:150px" dataType="Phone" msg="电话号码不正确" Require="false" id="telephone" name="telephone" value="${user.telephone}" maxlength="25"
				onfocus="currentBackgroundColor=this.style.backgroundColor;this.style.background='#FFFF99';" 
				onblur="this.style.backgroundColor=currentBackgroundColor;" style="height: 25px;"/>
          </td>
          
        </tr>
        <tr>
          <td width="20%" align="right">
          	联系地址：
          </td>
          <td colspan="3">
          		<input type="text" style="width:500px" id="address" name="address" value="${user.address}" maxlength="100"
				onfocus="currentBackgroundColor=this.style.backgroundColor;this.style.background='#FFFF99';" 
				onblur="this.style.backgroundColor=currentBackgroundColor;" style="height: 25px;"/>
          </td>
        </tr>
		<tr>
          <td colspan="4"><hr width="100%" align="left"></td>
		</tr>
        <tr>
          <td align="right"><input type="submit" name="Submit" value="修改" class="Button" /></td>
          <td><input type="button" name="Submit22" value="返回" class="Button"  onclick="window.location='<%=basePath%>/admin/system/userMgr/userMgr!listUser.action'"/></td>
        </tr>
      </table>
        </form>
    </td>
  </tr>
</table>
</body>
</html>
